package vsvm.gui.menus;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import vsvm.gui.Environment;
import vsvm.gui.forms.AboutDialog;

public class HelpMenu  extends JMenu {
	private final static String MH_ABOUT = "about";
	
	private JMenuItem miAbout = null;
	
	private class FileMenuActionListener implements ActionListener {

		public void actionPerformed(ActionEvent e) {
			if (e.getActionCommand().equals(MH_ABOUT)) {
				AboutDialog a = new AboutDialog(Environment.getEnvironment().getMainFrame());
				a.setVisible(true);
				return;
			}
		}
					
	}
	
	public HelpMenu() {
		super();
		this.setText("Help");
		createItems();		
	}
	
	private void createItems() {
		ActionListener ml = new FileMenuActionListener();
		
		miAbout = new JMenuItem("About");
		miAbout.setActionCommand(MH_ABOUT);
		miAbout.addActionListener(ml);
		
		this.add(miAbout);
	}
	

}
